# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pipname=hatch_jupyter_builder
pkgname=python-hatch-jupyter-builder
pkgver=0.8.3
pkgrel=2
pkgdesc='A hatch plugin to help build Jupyter packages'
arch=(any)
url='https://jupyter.org/'
license=(custom)
depends=(python-hatchling)
makedepends=(python-build python-installer)
checkdepends=(python-pytest python-pytest-mock)
source=(https://github.com/jupyterlab/hatch-jupyter-builder/releases/download/v$pkgver/${_pipname//-/_}-$pkgver.tar.gz)
sha256sums=('0dbd14a8aef6636764f88a8fd1fcc9a91921e5c50356e6aab251782f264ae960')

build() {
  cd $_pipname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pipname-$pkgver
  pytest -v
}

package() {
  cd $_pipname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname
}
